import config from "@/config"
import http from "@/utils/request"

export default {
	getPageList: {
		url: `${config.API_URL}/api/User/GetUserPageList`,
		name: "根据关键字获取对应的用户分页列表",
		get: async function(data={}){
			return await http.get(this.url, data);
		}
	},
	getUserListByRole: {
		url: `${config.API_URL}/api/User/GetUserListByRole`,
		name: "根据角色获取对应的用户列表信息",
		get: async function(data={}){
			return await http.get(this.url, data);
		}
	},
	getUserListByPost: {
		url: `${config.API_URL}/api/User/GetUserListByPost`,
		name: "根据岗位获取对应的用户列表信息",
		get: async function(data={}){
			return await http.get(this.url, data);
		}
	},
	getUserListByDepartment: {
		url: `${config.API_URL}/api/User/GetUserListByDepartment`,
		name: "根据部门获取对应的用户列表信息",
		get: async function(data={}){
			return await http.get(this.url, data);
		}
	},
	create: {
		url: `${config.API_URL}/api/User/Create`,
		name: "创建用户信息",
		post: async function(data={}){
			return await http.post(this.url, data);
		}
	},
	update: {
		url: `${config.API_URL}/api/User/Update`,
		name: "编辑用户信息",
		put: async function(data={}){
			return await http.put(this.url, data);
		}
	},
	resetPassword:{
		url: `${config.API_URL}/api/User/ResetPassword`,
		name: "重置密码",
		put: async function(data={}){
			return await http.put(this.url, data);
		}
	},
	forbidOrEnable: {
		url: `${config.API_URL}/api/User/ForbidOrEnable`,
		name: "禁用/启用用户",
		put: async function(data={}){
			return await http.put(this.url, data);
		}
	},
	deleteById: {
		url: `${config.API_URL}/api/User/DeleteById`,
		name: "根据Id删除用户信息",
		delete: async function(data={}){
			return await http.delete(this.url, data);
		}
	}
}
